From 0fe6d76ab6a5e0da97bc08922f05814a25d4315e Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Tue, 9 Jan 2018 17:48:51 -0500 Subject: [PATCH] Make size request warnings more useful Print the css name of the widget in question, so we have a chance of knowing that this is caused by the marks, not by the slider. --- gtk/gtksizerequest.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/gtk/gtksizerequest.c b/gtk/gtksizerequest.c index 507d0ecfe8..278d72dfb3 100644 --- a/gtk/gtksizerequest.c +++ b/gtk/gtksizerequest.c @@ -229,13 +229,17 @@ gtk_widget_query_size_for_orientation (GtkWidget *widget, { if (orientation == GTK_ORIENTATION_HORIZONTAL) { - g_warning ("%s %p reported min width %d and natural width %d in measure() with for_size=%d; natural size must be >= min size", - G_OBJECT_TYPE_NAME (widget), widget, min_size, nat_size, for_size); + g_warning ("%s %p (%s) reported min width %d and natural width %d in measure() with for_size=%d; natural size must be >= min size", + G_OBJECT_TYPE_NAME (widget), widget, + gtk_css_node_get_name (gtk_widget_get_css_node (widget)), + min_size, nat_size, for_size); } else { - g_warning ("%s %p reported min height %d and natural height %d in measure() with for_size=%d; natural size must be >= min size", - G_OBJECT_TYPE_NAME (widget), widget, min_size, nat_size, for_size); + g_warning ("%s %p (%s) reported min height %d and natural height %d in measure() with for_size=%d; natural size must be >= min size", + G_OBJECT_TYPE_NAME (widget), widget, + gtk_css_node_get_name (gtk_widget_get_css_node (widget)), + min_size, nat_size, for_size); } @@ -243,8 +247,9 @@ gtk_widget_query_size_for_orientation (GtkWidget *widget, } else if (G_UNLIKELY (min_size < 0)) { - g_warning ("%s %p reported min %s %d, but sizes must be >= 0", + g_warning ("%s %p (%s) reported min %s %d, but sizes must be >= 0", G_OBJECT_TYPE_NAME (widget), widget, + gtk_css_node_get_name (gtk_widget_get_css_node (widget)), orientation == GTK_ORIENTATION_HORIZONTAL ? "width" : "height", min_size); min_size = 0; -- 2.30.2